package com.nimbus.core.model.proxy;

import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.nimbus.core.model.User;
import com.easy.query.core.proxy.columns.types.SQLLongTypeColumn;
import com.easy.query.core.proxy.columns.types.SQLStringTypeColumn;
import com.easy.query.core.proxy.columns.types.SQLBooleanTypeColumn;
import com.easy.query.core.proxy.columns.types.SQLUtilDateTypeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author easy-query
 */
public class UserProxy extends AbstractProxyEntity<UserProxy, User> {

    private static final Class<User> entityClass = User.class;

    public static final UserProxy TABLE = createTable().createEmpty();

    public static UserProxy createTable() {
        return new UserProxy();
    }

    public UserProxy() {
    }

    /**
     * {@link User#getId}
     */
    public SQLLongTypeColumn<UserProxy> id() {
        return getLongTypeColumn("id");
    }

    /**
     * {@link User#getUsername}
     */
    public SQLStringTypeColumn<UserProxy> username() {
        return getStringTypeColumn("username");
    }

    /**
     * 用户名
     * {@link User#getPassword}
     */
    public SQLStringTypeColumn<UserProxy> password() {
        return getStringTypeColumn("password");
    }

    /**
     * 密码（加密）
     * {@link User#getEmail}
     */
    public SQLStringTypeColumn<UserProxy> email() {
        return getStringTypeColumn("email");
    }

    /**
     * 邮箱
     * {@link User#getRealName}
     */
    public SQLStringTypeColumn<UserProxy> realName() {
        return getStringTypeColumn("realName");
    }

    /**
     * 真实姓名
     * {@link User#getRole}
     */
    public SQLStringTypeColumn<UserProxy> role() {
        return getStringTypeColumn("role");
    }

    /**
     * 角色：adminuserguest
     * {@link User#getIsActive}
     */
    public SQLBooleanTypeColumn<UserProxy> isActive() {
        return getBooleanTypeColumn("isActive");
    }

    /**
     * 是否激活
     * {@link User#getCreatedAt}
     */
    public SQLUtilDateTypeColumn<UserProxy> createdAt() {
        return getUtilDateTypeColumn("createdAt");
    }

    /**
     * 创建时间
     * {@link User#getLastLoginTime}
     */
    public SQLUtilDateTypeColumn<UserProxy> lastLoginTime() {
        return getUtilDateTypeColumn("lastLoginTime");
    }


    @Override
    public Class<User> getEntityClass() {
        return entityClass;
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public UserProxyFetcher FETCHER = new UserProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class UserProxyFetcher extends AbstractFetcher<UserProxy, User, UserProxyFetcher> {

        public UserProxyFetcher(UserProxy proxy, UserProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link User#getId}
         */
        public UserProxyFetcher id() {
            return add(getProxy().id());
        }

        /**
         * {@link User#getUsername}
         */
        public UserProxyFetcher username() {
            return add(getProxy().username());
        }

        /**
         * 用户名
         * {@link User#getPassword}
         */
        public UserProxyFetcher password() {
            return add(getProxy().password());
        }

        /**
         * 密码（加密）
         * {@link User#getEmail}
         */
        public UserProxyFetcher email() {
            return add(getProxy().email());
        }

        /**
         * 邮箱
         * {@link User#getRealName}
         */
        public UserProxyFetcher realName() {
            return add(getProxy().realName());
        }

        /**
         * 真实姓名
         * {@link User#getRole}
         */
        public UserProxyFetcher role() {
            return add(getProxy().role());
        }

        /**
         * 角色：adminuserguest
         * {@link User#getIsActive}
         */
        public UserProxyFetcher isActive() {
            return add(getProxy().isActive());
        }

        /**
         * 是否激活
         * {@link User#getCreatedAt}
         */
        public UserProxyFetcher createdAt() {
            return add(getProxy().createdAt());
        }

        /**
         * 创建时间
         * {@link User#getLastLoginTime}
         */
        public UserProxyFetcher lastLoginTime() {
            return add(getProxy().lastLoginTime());
        }


        @Override
        protected UserProxyFetcher createFetcher(UserProxy cp, AbstractFetcher<UserProxy, User, UserProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new UserProxyFetcher(cp, this, sqlSelectExpression);
        }
    }


    public static final class Fields {
        public static final String id = "id";
        public static final String username = "username";
        public static final String password = "password";
        public static final String email = "email";
        public static final String realName = "realName";
        public static final String role = "role";
        public static final String isActive = "isActive";
        public static final String createdAt = "createdAt";
        public static final String lastLoginTime = "lastLoginTime";

        private Fields() {
        }
    }
}
